<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>205-取反.html</title>
</head>
<body>
	<textarea name="" id="" cols="30" rows="10"></textarea>
	<button id="btn">过滤</button>
	<textarea name="" id="" cols="30" rows="10"></textarea>
</body>
<script>
	// var str = "asd 345 fgh"; 
	// var reg = /[a-z]/g;
	// var reg1 = /[0-9]/g;
	// var reg2 = /[^a-z]/g;

	// console.log(str);
	// console.log(str.replace(reg,"*"));
	// console.log(str.replace(reg1,"*"));
	

	var oTxt = document.getElementById('txt');
	var oBtn = document.getElementById('btn');
	var oTxt1 = document.getElementById('txt1');

	oBtn.onclick = function(){
		var reg = /<[^<>]+>/g;
		oTxt1.value = oTxt.value.replace(reg,"*");
	}
</script>
</html>